<%@taglib uri="/struts-tags" prefix="s" %>
<jsp:include page="includes/head.jsp" />  	 
    <div id="box">
    <jsp:include page="includes/nav.jsp" />  	        
        <div id="box-content">                           
     		<h2>New Constraint</h2>               
                   
           	<p>Add new constraint XML to validate.</p> 
            <p>You can edit the constraint, on page <a href="${initParam.url}list">List Constraint</a>.</p>
           <div class="line"></div>   
                     
			<form method="post"  action="${initParam.url}constraint" name="form" onsubmit="return validateForm()">		
				
				<label for="typeConstraint">Select Type Constraint:</label>
                <select name="type" id="typeConstraint">
                  <option value="XDF">XDF</option>
                  <option value="XDFC">XDFC</option>
                </select>  
                				
                <label for="nameConstraint">Name Constraint:</label>
                <input name="nameConstraint" id="nameConstraint" type="text"  value="${nameConstraint}"/>
                
                <label for="contex">Context Path:</label>
                <input name="contex" id="contex" type="text" value="${contex}">

                <label for="leftPath">Left Path:</label>
                <input name="leftPath" id="leftPath" type="text"  value="${leftPath}">
               
                <label for="leftValue">Type of equality Left:</label>
                <input name="leftValue" id="leftValue" type="text" placeholder="(v or n with commas ex.'v,n,v')"  value="${leftValue}">       
                                
                <label for="rightPath">Right Path:</label>
                <input name="rightPath" type="text" id="rightPath" value="${rightPath}">

                <label for="rightValue">Type of equality Right:</label>                              
                <select name="rightValue" id="rightValue">
                  <option value="value"  ${(rightValue == '0' ) ? 'selected="selected"' : ''} >Value</option>
                  <option value="node" 	 ${(rightValue == '1' ) ? 'selected="selected"' : ''} >Node</option>
                </select>           
                     
				<div id="cond">
	                <label for="condExp">Condition:</label>
	                <input name="condition" id="condExp" type="text" value="${condition}">
                </div>                
              <!--   
     <textarea name="message" placeholder="Your comments here"></textarea> -->
                
                <input class="submit" type="submit" value="${(empty nameConstraint) ? 'New Constraint' : 'Edit Constraint' }">
				<input type="hidden" name="action" value="${(empty nameConstraint) ? 'insert' : 'edit' }">
				<input type="hidden" name="id" value="${(empty nameConstraint) ? '-1' : id}">                         
                
                </form>            
                       
  
            </div>     
        <div class="clear"></div>
    </div>   
</body>
</html>